<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>

<%@include file="../layout/_head_css.jsp"%>


</head>

<body>
    <%@include file="../layout/_menu.jsp"%>
    <!-- Dashboard Wrapper Start -->
    <div class="dashboard-wrapper">
        <%@include file="../layout/_head_header.jsp"%>

            <!-- Main Container Start -->
            <div class="main-container">

                <!-- Top Bar Starts -->
                <div class="top-bar clearfix">
                    <div class="page-title">
                        <h4><div class="fs1" aria-hidden="true" data-icon="&#xe0a0;"></div>Default Layout <a href="invoice.html" class="samll">Bonus Pages</a></h4>
                    </div>
                    <ul class="right-stats hidden-xs" id="mini-nav-right">
                        <li class="reportrange btn btn-success">
                            <i class="fa fa-calendar"></i>
                            <span></span> <b class="caret"></b>
                        </li>
                        <li>
                            <a href="#" class="btn btn-info sb-open-right sb-close">
                                <div class="fs1" aria-hidden="true" data-icon="&#xe06a;"></div>
                            </a>
                        </li>
                    </ul>
                </div>
                <!-- Top Bar Ends -->

                <!-- Container fluid Starts -->
                <div class="container-fluid">

                    <!-- Spacer starts -->
                    <div class="spacer-xs">

                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4>订单列表</h4>

                            </div>

                            <div class="panel-body">
                                <table align="right">
                                    <tr>
                                        <td >
                                            <p color='red'>
                                                当前用户：
                                                ${sessionScope.USER_IN_SESSIONSCOPE.userName }
                                                上一次登录时间：
                                                ${sessionScope.USER_IN_SESSIONSCOPE.lastDate}
                                            </p>
                                        </td>
                                    </tr>


                                </table>
                                <table class="table table-bordered " border="1" width="100%">

                                    <tr>
                                        <th>订单编号</th>
                                        <th>下单时间</th>
                                        <th>订单总金额</th>
                                        <th>状态</th>
                                        <th>订单来源</th>
                                        <th>收货人姓名</th>
                                        <th>收货人电话</th>
                                        <th>收货地址</th>
                                        <th>操作</th>

                                    </tr>
                                    <c:if test="${empty ORDERLIST}">
                                        <tr>
                                            <td colspan="10"style="color: red">你没有任何订单，请先添加！</td>
                                        </tr>
                                    </c:if>
                                    <c:if test="${not empty ORDERLIST}">
                                        <c:forEach items="${ORDERLIST}" var="order">
                                            <tr>

                                                <td>${order.orderId}</td>
                                                <td>
                                                    <fmt:formatDate value="${order.buyTime}" pattern="yyyy年MM月dd日 HH时mm分ss秒"/>
                                                </td>
                                                <td>
                                                    <fmt:formatNumber value="${order.totalMoney}" pattern="0.00"/>
                                                </td>
                                                <td id="${order.orderId}_status_text">
                                                    <span class="label label-warning ">${order.status.text}</span>

                                                </td>
                                                <td>${order.sources.text}</td>
                                                <td>${order.receiverName}</td>
                                                <td>${order.receiverPhone}</td>
                                                <td>${order.address}</td>
                                                <td>
                                                    <c:if test="${order.status=='NO_PAYMENT'}">
                                                        <a href="/orders/payment?orderId=${order.orderId}"
                                                           class="btn btn-sm btn-warning btn_payment">支付</a>
                                                        <a  class="btn btn-sm btn-danger">取消</a>
                                                    </c:if>
                                                </td>
                                            </tr>
                                        </c:forEach>
                                    </c:if>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!-- Spacer ends -->

                </div>
                <!-- Container fluid ends -->

            </div>
            <!-- Main Container Start -->
        <!-- Footer Start -->

            <%@include file="../layout/_footer.jsp"%>
        
        <!-- Footer end -->
    </div>
    <!-- Dashboard Wrapper End -->
 <%@include file="../layout/_footer_js.jsp"%>
    <script  language="JavaScript" href="assets/app/js/order.js"></script>
</body>
</html>